package com.shycloud.mido.task.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shycloud.mido.common.core.constant.CommonConstants;
import com.shycloud.mido.common.core.exception.BusinessException;
import com.shycloud.mido.common.core.util.R;
import com.shycloud.mido.common.security.util.SecurityUtils;
import com.shycloud.mido.member.api.entity.*;
import com.shycloud.mido.member.api.vo.MyTeacherVO;
import com.shycloud.mido.member.api.vo.SmMemberTeacherGroupVO;
import com.shycloud.mido.member.api.vo.StudentVO;
import com.shycloud.mido.task.mapper.*;
import com.shycloud.mido.task.service.TeacherService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * 教师模块实现类
 *
 * @author nianhua.jiang
 * @date 2020/6/16 13:55
 */
@Service
@AllArgsConstructor
public class TeacherServiceImpl extends ServiceImpl<OrgTeacherDetailedMapper, OrgTeacherDetailed> implements TeacherService {

	/** 教师详情模块 mapper */
	private OrgTeacherDetailedMapper teacherDetailedMapper;

	/**
	 * 获取教师ID
	 *
	 * @param
	 * @return com.shycloud.mido.member.api.entity.OrgTeacherDetailed
	 * @author nianhua.jiang
	 * @date 2020/6/22 16:43
	 */
	@Override
	public OrgTeacherDetailed getTeacher(Integer orgId, String memberId) {
		return teacherDetailedMapper.selectOne(new QueryWrapper<OrgTeacherDetailed>()
				.eq(OrgTeacherDetailed.COL_ORG_ID, orgId)
				.and(x -> x.eq(OrgTeacherDetailed.COL_MEMBER_ID, memberId)));
	}

}
